package com.esri.core.internal.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/* loaded from: classes.dex */
public final class b {
    public static final String a = "yyyy-MM-dd'T'HH:mm:ssZ";

    public static long a(Object obj) {
        if (obj == null) {
            return Long.MIN_VALUE;
        }
        if (obj instanceof Date) {
            return ((Date) obj).getTime();
        }
        if (obj instanceof Calendar) {
            return ((Calendar) obj).getTimeInMillis();
        }
        if (obj instanceof String) {
            return new Date((String) obj).getTime();
        }
        if (obj instanceof Long) {
            return ((Long) obj).longValue();
        }
        return Long.MIN_VALUE;
    }

    public static String a(Long l) {
        if (l != null) {
            return a(new Date(l.longValue()));
        }
        return null;
    }

    public static String a(Date date) {
        if (date != null) {
            return new SimpleDateFormat(a, Locale.US).format(date);
        }
        return null;
    }
}
